/**
 * Copyright 2014  XCL-Charts
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 * @Project XCL-Charts
 * @Description Android图表基类库
 * @author XiongChuanLiang<br></br>(xcl_168@aliyun.com)
 * @license http://www.apache.org/licenses/  Apache v2 License
 * @version 2.1
 */
package org.xclcharts.chart

/**
 * @ClassName Funnel2Data
 * @Description 漏斗图数据类
 * @author XiongChuanLiang<br></br>(xcl_168@aliyun.com)
 */
class Funnel2Data : Comparable<Funnel2Data> {
    /**
     * 返回标签
     * @return 标签
     */
    /**
     * 设置标签
     * @param value 标签内容
     */
    var label: String? = null
    /**
     * 返回基数集合
     * @return 基数
     */
    /**
     * 设置基数数据源
     * @param data 初始值
     */
    //private String mKey;
    //private float mData;
    var baseData = 0f
    /**
     * 返回百分比数据
     * @return 所占比数据(0-1)
     */
    /**
     * 设置百分比数据源,即基数在最后所占的百分比
     * @param percent 所占百分比(0-1)
     */
    var percentData = 0f

    /**
     * 设置颜色
     * @param value 颜色
     */
    var color = 0

    //透明度
    var alpha = -1

    constructor() {}
    constructor(label: String?, base: Float, percent: Float, color: Int) {
        this.label = label
        //setKey(key);
        baseData = base
        percentData = percent
        this.color = color
    }

    /**
     * 设置Key值
     * @param value Key值
     */
    //public void setKey(String value) 
    //{
    //	mKey = value;
    //}
    override fun compareTo(arg0: Funnel2Data): Int {
        val a = baseData
        val b = arg0.baseData
        return java.lang.Float.compare(a, b)
    }
}